using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class patient1Map : EntityTypeConfiguration<patient1>
    {
        public patient1Map()
        {
            // Primary Key
            this.HasKey(t => new { t.IDM, t.ARACCT });

            // Properties
            this.Property(t => t.ID)
                .HasMaxLength(6);

            this.Property(t => t.IDM)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            this.Property(t => t.CUSTSRH)
                .HasMaxLength(6);

            this.Property(t => t.CaseNb)
                .HasMaxLength(15);

            this.Property(t => t.COMPANY)
                .HasMaxLength(51);

            this.Property(t => t.SALUTATION)
                .HasMaxLength(15);

            this.Property(t => t.FIRST_NM)
                .HasMaxLength(25);

            this.Property(t => t.FATHER_NM)
                .HasMaxLength(20);

            this.Property(t => t.LAST_NM)
                .HasMaxLength(25);

            this.Property(t => t.occupat)
                .IsFixedLength()
                .HasMaxLength(20);

            this.Property(t => t.GENDER)
                .HasMaxLength(7);

            this.Property(t => t.CITY)
                .HasMaxLength(30);

            this.Property(t => t.ADDR2)
                .HasMaxLength(35);

            this.Property(t => t.ADDR1)
                .HasMaxLength(200);

            this.Property(t => t.PHONE)
                .HasMaxLength(19);

            this.Property(t => t.WORK_PH1)
                .HasMaxLength(19);

            this.Property(t => t.WORK_PH2)
                .HasMaxLength(19);

            this.Property(t => t.FAX)
                .HasMaxLength(19);

            this.Property(t => t.PcPhysician)
                .HasMaxLength(6);

            this.Property(t => t.STATE)
                .HasMaxLength(3);

            this.Property(t => t.ZIP)
                .HasMaxLength(12);

            this.Property(t => t.emp)
                .IsFixedLength()
                .HasMaxLength(20);

            this.Property(t => t.SSCODE)
                .HasMaxLength(19);

            this.Property(t => t.DLNUMBER)
                .HasMaxLength(19);

            this.Property(t => t.misc_code)
                .IsFixedLength()
                .HasMaxLength(24);

            this.Property(t => t.PO_BOX)
                .HasMaxLength(12);

            this.Property(t => t.MOBILE)
                .HasMaxLength(19);

            this.Property(t => t.PAGER)
                .HasMaxLength(12);

            this.Property(t => t.aname)
                .IsFixedLength()
                .HasMaxLength(51);

            this.Property(t => t.ASALUTA)
                .HasMaxLength(15);

            this.Property(t => t.AFIRST_NM)
                .HasMaxLength(25);

            this.Property(t => t.AFATHER)
                .HasMaxLength(20);

            this.Property(t => t.ALAST_NM)
                .HasMaxLength(25);

            this.Property(t => t.email)
                .IsFixedLength()
                .HasMaxLength(50);

            this.Property(t => t.mother)
                .IsFixedLength()
                .HasMaxLength(20);

            this.Property(t => t.amother)
                .IsFixedLength()
                .HasMaxLength(20);

            this.Property(t => t.ARACCT)
                .IsRequired()
                .HasMaxLength(40);

            // Table & Column Mappings
            this.ToTable("patient1");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.IDM).HasColumnName("IDM");
            this.Property(t => t.CUSTSRH).HasColumnName("CUSTSRH");
            this.Property(t => t.CaseNb).HasColumnName("CaseNb");
            this.Property(t => t.COMPANY).HasColumnName("COMPANY");
            this.Property(t => t.SALUTATION).HasColumnName("SALUTATION");
            this.Property(t => t.FIRST_NM).HasColumnName("FIRST_NM");
            this.Property(t => t.FATHER_NM).HasColumnName("FATHER_NM");
            this.Property(t => t.LAST_NM).HasColumnName("LAST_NM");
            this.Property(t => t.occupat).HasColumnName("occupat");
            this.Property(t => t.BDATE).HasColumnName("BDATE");
            this.Property(t => t.GENDER).HasColumnName("GENDER");
            this.Property(t => t.CITY).HasColumnName("CITY");
            this.Property(t => t.ADDR2).HasColumnName("ADDR2");
            this.Property(t => t.ADDR1).HasColumnName("ADDR1");
            this.Property(t => t.PHONE).HasColumnName("PHONE");
            this.Property(t => t.WORK_PH1).HasColumnName("WORK_PH1");
            this.Property(t => t.WORK_PH2).HasColumnName("WORK_PH2");
            this.Property(t => t.FAX).HasColumnName("FAX");
            this.Property(t => t.FRPhysician).HasColumnName("FRPhysician");
            this.Property(t => t.DATEADDED).HasColumnName("DATEADDED");
            this.Property(t => t.PcPhysician).HasColumnName("PcPhysician");
            this.Property(t => t.STATE).HasColumnName("STATE");
            this.Property(t => t.ZIP).HasColumnName("ZIP");
            this.Property(t => t.emp).HasColumnName("emp");
            this.Property(t => t.SSCODE).HasColumnName("SSCODE");
            this.Property(t => t.DLNUMBER).HasColumnName("DLNUMBER");
            this.Property(t => t.LASTSALE).HasColumnName("LASTSALE");
            this.Property(t => t.MARITALSTATUS).HasColumnName("MARITALSTATUS");
            this.Property(t => t.misc_code).HasColumnName("misc_code");
            this.Property(t => t.PCODE).HasColumnName("PCODE");
            this.Property(t => t.DISCOUNT).HasColumnName("DISCOUNT");
            this.Property(t => t.PO_BOX).HasColumnName("PO_BOX");
            this.Property(t => t.MOBILE).HasColumnName("MOBILE");
            this.Property(t => t.PAGER).HasColumnName("PAGER");
            this.Property(t => t.aname).HasColumnName("aname");
            this.Property(t => t.ASALUTA).HasColumnName("ASALUTA");
            this.Property(t => t.AFIRST_NM).HasColumnName("AFIRST_NM");
            this.Property(t => t.AFATHER).HasColumnName("AFATHER");
            this.Property(t => t.ALAST_NM).HasColumnName("ALAST_NM");
            this.Property(t => t.email).HasColumnName("email");
            this.Property(t => t.active).HasColumnName("active");
            this.Property(t => t.NATIONALITY).HasColumnName("NATIONALITY");
            this.Property(t => t.mother).HasColumnName("mother");
            this.Property(t => t.amother).HasColumnName("amother");
            this.Property(t => t.ARACCT).HasColumnName("ARACCT");
        }
    }
}
